#ifndef INK_MODULE_MGR_H_INCLUDED
#define INK_MODULE_MGR_H_INCLUDED

#include "ink_foundation.h"

#include <map>

namespace ink
{

class module_i;
class module_creator;

class module_mgr {
public:
    module_i* get_module_by_id(uint32_t id);

    void add_module(module_i* module);

    void register_creator( const std::string& name, module_creator* creator );

    module_i* create_module( const std::string& name );
private:
    typedef std::map<uint32_t, module_i*> module_container_t;
    module_container_t modules_;

    typedef std::map<uint32_t, module_creator*> module_creator_container_t;
    module_creator_container_t module_creators_;
};

} // namespace ink

#endif // INK_MODULE_MGR_H_INCLUDED